package org.linkerproject.html;

public class HtmlPage {

	public HtmlPage(String title) {
		this.title = title;
	}

	public String output() {
		StringBuffer html = new StringBuffer("<html>");

		HtmlText titleElement = new HtmlText("title", title);
		headContainer.addElement(titleElement);
		html.append(headContainer.output());
		html.append(bodyContainer.output());
		html.append("</html>");

		return html.toString();
	}

	public void addBodyContent(HtmlElement link) {
		bodyContainer.addElement(link);
	}

	private String title;

	private HtmlContainer headContainer = new HtmlContainer("head");
	private HtmlContainer bodyContainer = new HtmlContainer("body");

}
